package com.meida.module.system.provider.handerl;

import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.interceptor.SaveInterceptor;
import com.meida.common.mybatis.query.CriteriaSave;
import com.meida.module.system.client.entity.SysDict;
import com.meida.module.system.provider.service.SysDictService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 字典保存
 * @author zyf
 */
@Component("dictSaveHandler")
@Log4j2
public class DictSaveHandler implements SaveInterceptor<SysDict> {

    @Autowired
    private SysDictService dictService;

    @Override
    public void prepare(CriteriaSave cs, EntityMap params, SysDict dict) {

    }

    @Override
    public void complete(CriteriaSave cs, EntityMap params, SysDict dict) {
        dictService.initDictRedis();
    }
}
